package com.nbjtjc.safe.mapper.sys;

import com.nbjtjc.safe.model.sys.SysOptionGroup;
import com.nbjtjc.util.MyMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface SysOptionGroupMapper extends MyMapper<SysOptionGroup> {
    @Select("select * from sys_option_group where groupId =#{groupId}")
    List<SysOptionGroup> findOptionGroupByGroupId(@Param("groupId") int groupId);

    List<SysOptionGroup> selectOptionGroupWithName(@Param("groupId") int groupId);

    @Select("select optId from sys_option_group where groupId=#{groupId}")
    List<Integer> selectedOptionIds(@Param("groupId") int groupId);


    @Update("delete from sys_option_group where groupId=#{groupId}")
    int deleteByGroupId(@Param("groupId") int groupId);

    List<SysOptionGroup> search(@Param("og") SysOptionGroup sysOptionGroup);
}